ADO/ODBC Form Genie

Description

The ADO/ODBC Form Genie creates an Xdialog dialog box that can be used to read, write, and browse through ADO and ODBC compliant databases. The form is highly customizable and can be displayed in traditional browse and form formats, as well as a new hybrid format, called a repeating form.

The ADO/ODBC Form Genie is available through Action Scripting. To display the genie:

  1. Navigate to the Code tab of the Control Panel.

  2. Click the following.

    images/Action_Script_button.gif
  3. Click the green '+' icon.

  4. Select "Xdialog Windows" from the Category list and "Display Xdialog Form based on ADO/ODBC data" from the Action list.

Database Connections

The genie supports two types of external database connections.

  • Microsoft Access .MDB files

  • Other databases that support the ADO or ODBC protocols (specified by an ADO Connection string). Picture

    images/ADO_ODBC_1.gif

Once you open a connection to the database, you can select data by:

  • picking a table or view from a list

  • entering a SQL Select statement

If you are opening a database with an ADO Connection string, you can:

  • Select an existing connection string

  • Build a new connection string (using the Windows Data Link Properties dialog box)

If you create a new connection string, the Data Link Properties dialog box gives you the opportunity to select among the following database types.

images/ADO_Genie_Data_Link_Provider.gif

In addition, if you retrieve the data by table or view, you can optionally apply both filter and order expressions to the record selection.

images/ADO_ODBC_2.gif

Fields and Formats

Next, the genie allows you to pick which fields you want to display.

You must include the primary key(s) of the table in the list of Selected Fields.

This page of the genie allows you to set their order of appearance and various display properties, including:

  • Label

  • Hot Label

  • Control type (text box, list box, etc.)

  • Width

  • Height

  • Tab Page

    images/ADO_ODBC_3.gif

In addition, you can specify Update Rules for each field. These rules include:

  • Whether the field is read-only or write-able

  • The table and field to update (if write-able)

  • Whether to auto-increment the value of the field

  • Whether blank values will be represented by NULL

    images/ADO_Genie_Field_Update_Rules.gif

Then, you can select which of 15 available record navigation controls, function buttons, and status fields you would like to display, and set their order of appearance. These buttons include:

  • First, Previous, Next, Last

  • Record Position, Record Count

  • New Record, Save Record, Delete Record

  • Undo Edits

  • Filter, Apply Filter, Clear Filter, Show All, Exit Filter Mode

  • Close

You can also set their display properties, including:

  • Type (Picture, Text)

  • Label (if Text)

  • Image (if Picture)

  • Border (if Picture)

  • Bubble Help text

    images/ADO_Genie_Button_Properties.gif

Next, you can set the properties of the form, including:

  • Window title

  • Background color

  • Font

  • Button bar position ("Bottom", "Top", "Bottom and Top", "None")

  • whether to enclose the buttons in a frame

  • Form type ("Modal", "Modeless", "MDI Child Window")

  • If not "Modal", whether to allow multiple instances

  • If "MDI Child Window", the toolbar, menu, and Title bar icon to use

    images/ADO_Genie_Window_Properties.gif

Display Options

You can set various layout options. The style of display can be either:

  • Form

  • Table

If you select the "Form" style, you can have a Repeating Form. In this case you can specify:

  • the number of rows

  • the number of columns

and whether the forms are organized from:

  • top to bottom, then left to right

  • left to right, the top to bottom

This is a familiar single record form.

images/ADO_Genie_Form_Layout.gif

The following is an example of a Table style form. You can set the number of lines to display in the table.

images/ADO_Genie_Table_Layout.gif

This is a repeating form. If you added a new record, the form would display records 2 through 7.

images/ADO_Genie_Repeating_Form_Layout.gif

Record Set Filters

Clicking on a field label produces a menu that lets you:

  • Sort the record set on the selected field in ascending order

  • Sort the record set on the selected field in descending order

  • Filter on the field (select only records with matching values)

  • Exclude on the field (select only records with non-matching values)

    images/ADO_Genie_Field_Menu.gif

Clicking the Filter by Form icon clears the fields of the form and allows you to make queries against the record set.

images/Query_by_Form_button.gif

The following picture show a query in process. Clicking on the run icon will extract a subset of the record set that you can scroll through, read, and edit.

images/Run_button.gif

Clicking the following removes the filter and re-displays the full record set.

images/Show_All_button.gif
images/ADO_Genie_Filter_by_Form.gif